{extend name="public/base" /}
{block name='content'}
{include file='public/content_header' /}
<!--数据列表页面-->
<section class="content">

    <!--顶部搜索筛选-->
    <div class="row">
        <div class="col-md-12">
            <div class="box">
                <div class="box-body">
                    <form class="form-inline searchForm" id="searchForm" action="{:url('stamporder')}" method="GET">

                        <div class="form-group" style="padding-top: 3px;">
                            <input value="{$member_id ? $member_id : '' ;}"
                                   name="member_id" id="member_id" class="form-control input-sm"
                                   placeholder="充值者用户融云ID搜索">
                        </div>
<!--                        <div class="form-group" style="padding-top: 3px;">-->
<!--                            <input value="{$me_uid ? $me_uid : '' ;}"-->
<!--                                   name="me_uid" id="me_uid" class="form-control input-sm"-->
<!--                                   placeholder="用户UID搜索">-->
<!--                        </div>-->
<!--                        <div class="form-group" style="padding-top: 3px;">-->
<!--                            <input value="{$me_phone ? $me_phone : '' ;}"-->
<!--                                   name="me_phone" id="me_phone" class="form-control input-sm"-->
<!--                                   placeholder="用户手机号/昵称搜索">-->
<!--                        </div>-->
                        <div class="form-group" style="padding-top: 3px;">
                            <input value="{$fmember_id ? $fmember_id : '' ;}"
                                   name="fmember_id" id="fmember_id" class="form-control input-sm"
                                   placeholder="上级用户融云ID搜索">
                        </div>

                        <div class="form-group" style="padding-top: 3px;">
                            <select name="qd" id="qd" class="form-control input-sm index-search">
                                <option value="">- 渠道搜索 -</option>
                                <option value="快手"{if isset($qd) && $qd=='快手'}selected{/if}>快手</option>
                                <option value="抖音"{if isset($qd) && $qd=='抖音'}selected{/if}>抖音</option>
                                <option value="vivo"{if isset($qd) && $qd=='vivo'}selected{/if}>vivo</option>
                                <option value="oppo"{if isset($qd) && $qd=='oppo'}selected{/if}>oppo</option>
                                <option value="小米"{if isset($qd) && $qd=='小米'}selected{/if}>小米</option>
                            </select>
                        </div>
                        <div class="form-group" style="padding-top: 3px;">
                            <select name="phone_agent" id="phone_agent" class="form-control input-sm index-search">
                                <option value="">- 注册设备 -</option>
                                <option value="android"{if isset($phone_agent) && $phone_agent=='android'}selected{/if}>安卓</option>
                                <option value="ios"{if isset($phone_agent) && $phone_agent=='ios'}selected{/if}>IOS</option>
                            </select>
                        </div>
                        <div class="form-group" style="padding-top: 3px;">
                            <select name="type" id="type" class="form-control input-sm index-search">
                                <option value="">- 支付类型 -</option>
                                <option value="1"{if isset($type) && $type=='1'}selected{/if}>微信</option>
                                <option value="2"{if isset($type) && $type=='2'}selected{/if}>支付宝</option>
                            </select>
                        </div>
                        <div class="form-group" style="padding-top: 3px;">
                            <input value="{$order_number ? $order_number : '' ;}"
                                   name="order_number" id="order_number" class="form-control input-sm"
                                   placeholder="充值订单号搜索">
                        </div>
                        <div class="form-group" style="padding-top: 3px;width: 280px;">
                            <input style="width: 95%" value="{$me_add_time|default=''}" readonly name="me_add_time" id="me_add_time"
                                   class="form-control input-sm indexSearchDateRange" placeholder="用户注册时间搜索">
                        </div>
                        <script>
                            laydate.render({
                                elem: '#me_add_time',
                                type: 'datetime',
                                range: true,
                            });
                        </script>
                        <div class="form-group" style="padding-top: 3px;width: 280px;">
                            <input style="width: 95%" value="{$add_time|default=$dr_time_date}" readonly name="add_time" id="add_time"
                                   class="form-control input-sm indexSearchDateRange" placeholder="充值时间搜索">
                        </div>
                        <script>
                            laydate.render({
                                elem: '#add_time',
                                type: 'datetime',
                                range: true,
                            });
                        </script>

                        <div class="form-group" style="padding-top: 3px;">
                            <button class="btn btn-sm btn-primary" type="submit"><i class="fa fa-search"></i> 查询
                            </button>
                        </div>

                        <div class="form-group" style="padding-top: 3px;">
                            <button onclick="clearSearchForm()" class="btn btn-sm btn-default" type="button"><i
                                    class="fa  fa-eraser"></i> 恢复默认查询
                            </button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-md-12">
            <div class="box">

                <!--数据列表顶部-->
                <div class="box-header">
                    <div>
                        <a class="btn btn-success btn-sm ReloadButton" data-toggle="tooltip" title="刷新">
                            <i class="fa fa-refresh"></i> 刷新
                        </a>
                        <b><span style="color: red">【</span>微信充值：{$wxpaymoney} 元（ 信息流 {$wxpaymoneyXxl} 元 + 非信息流 {$wxpaymoneyXxlNo} 元 ）<span style="color: red">】</span>  <span style="color: red">【</span>支付宝充值：{$zfbpaymoney} 元（ 信息流 {$zfbpaymoneyXxl} 元 + 非信息流 {$zfbpaymoneyXxlNo} 元 ）<span style="color: red">】</span>  <span style="color: red">【</span>总充值：{$totalpaymoney} 元（ 信息流 {$wxXxlZ} 元 + 非信息流 {$zfbXxlZ} 元 ）<span style="color: red">】</span></b>
                    </div>
                </div>

                <div class="box-body table-responsive">
                    <table class="table table-hover table-bordered datatable" width="100%">
                        <thead>
                        <tr style="white-space: nowrap">
                            <th style="text-align: center;vertical-align: middle;width: 5%">订单ID</th>
                            <th style="text-align: center;vertical-align: middle;width: 10%">充值用户信息</th>
                            <th style="text-align: center;vertical-align: middle;width: 10%">上级用户信息</th>
                            <th style="text-align: center;vertical-align: middle;width: 5%">绑定方式</th>
                            <th style="text-align: center;vertical-align: middle;width: 10%">顶级用户</th>
                            <th style="text-align: center;vertical-align: middle;width: 5%">注册设备</th>
<!--                            <th style="text-align: center;vertical-align: middle;width: 5%">注册渠道</th>-->
                            <th style="text-align: center;vertical-align: middle;width: 5%">支付类型</th>
                            <th style="text-align: center;vertical-align: middle;width: 5%">充值订单号</th>
                            <th style="text-align: center;vertical-align: middle;width: 5%">充值油票数</th>
                            <th style="text-align: center;vertical-align: middle;width: 5%">支付金额</th>
                            <th style="text-align: center;vertical-align: middle;width: 5%">充值时间</th>
                            <th style="text-align: center;vertical-align: middle;width: 5%">是否首充</th>
                        </tr>
                        </thead>
                        <tbody>
                        {foreach name='data' id='item' key='data_key'}
                        <tr>
                            <td style="text-align: center;vertical-align: middle;">{$item.id}</td>
                            <td style="text-align: center;vertical-align: middle;">【融云ID：{$item.member_id}】【UID：{$item.me_uid}】【昵称：{$item.me_nick_name}】【手机号：{$item.me_phone}】</td>

                            {if $item.f_member_id == 0}
                            <td style="text-align: center;vertical-align: middle;">充值时无上级</td>
                            {/if}
                            {if $item.f_member_id != 0}
                            <td style="text-align: center;vertical-align: middle;">【融云ID：{$item.f_member_id}】【UID：{$item.f_me_uid}】【昵称：{$item.f_me_nick_name}】【手机号：{$item.f_me_phone}】</td>
                            {/if}

                            {if $item.f_member_id == 0}
                            <td style="text-align: center;vertical-align: middle;">-</td>
                            {/if}
                            {if $item.f_member_id != 0}
                            <td style="text-align: center;vertical-align: middle;">{$item.me_bind_type_word}</td>
                            {/if}

                            <td style="text-align: center;vertical-align: middle;">{$item.dj_member_word}
                                {if $item.dj_member_id != 0}
                                    <a data-id="{$item.dj_member_id}" data-width="700px" data-height="350px" data-url="setbzname" data-confirm="2" data-type="2"
                                       class="btn btn-warning btn-xs AjaxButton"  title="为此顶级用户设置备注姓名" data-toggle="tooltip">
                                        设置
                                    </a>
                                {/if}
                            </td>

                            <td style="text-align: center;vertical-align: middle;">{$item.phone_agent_word}</td>
<!--                            <td style="text-align: center;vertical-align: middle;">{$item.me_qd}</td>-->
                            <td style="text-align: center;vertical-align: middle;">{$item.type_word}</td>
                            <td style="text-align: center;vertical-align: middle;">{$item.order_number}</td>
                            <td style="text-align: center;vertical-align: middle;">{$item.all_stamp_num}</td>
                            <td style="text-align: center;vertical-align: middle;">{$item.pay_money} 元</td>
                            <td style="text-align: center;vertical-align: middle;">{$item.add_time}</td>

                            {if $item.is_shou == 0}
                            <td style="text-align: center;vertical-align: middle;">否</td>
                            {/if}
                            {if $item.is_shou != 0}
                            <td style="text-align: center;vertical-align: middle;">是</td>
                            {/if}

                        </tr>
                        {/foreach}
                        </tbody>
                    </table>
                </div>

                <!-- 数据列表底部 -->
                <div class="box-footer">
                    {$page|raw}
                    <label class="control-label pull-right" style="margin-right: 10px; font-weight: 100;">
                        <small>共{$total}条记录</small>&nbsp;
                        <small>每页显示</small>
                        &nbsp;
                        <select class="input-sm" onchange="changePerPage(this)">
                            <option value="10" {if $admin.per_page==10}selected{/if}>10</option>
                            <option value="20" {if $admin.per_page==20}selected{/if}>20</option>
                            <option value="30" {if $admin.per_page==30}selected{/if}>30</option>
                            <option value="50" {if $admin.per_page==50}selected{/if}>50</option>
                            <option value="100" {if $admin.per_page==100}selected{/if}>100</option>
                        </select>
                        &nbsp;
                        <small>条记录</small>
                    </label>
                </div>

            </div>
        </div>
    </div>
</section>
<script>
    $(function () {
        $('.photo-list img').on('click', function () {
            layer.photos({
                photos: '.photo-list',
                shadeClose: false,
                closeBtn: 2,
                anim: 5
            });
        })
    });
</script>
{/block}

